import fetch from '@system.fetch';

export default {
    data: {
        title: 'World',
        formData:{
            "LoginID": "",
            "Password": "",
            "ZhuanYeId": 0,
            "PhoneIMEI": "01801A89A0AD4418F2A8A16C414BD73867622F06",
            "WorkPhone": "15000000001"
        },
    },
    change1(value){
        console.info(this.username+"this.username")
    },

    /*获取用户名*/
    getUserName(e){
        this.formData.LoginID=e.value
    },
    /*获取密码*/
    getPassword(e){
        this.formData.Password=e.value
    },
    /*登录*/
    buttonClick(e){
        const URL = "http://218.107.49.182:40837/WebAPI/App.ashx?"
        //请求标志
        const module="module=login"
        //请求参数
        const param="param="+escape(JSON.stringify(this.formData))

        fetch.fetch({
            url: URL+module+'&'+param,//拼接请求
            responseType: "json",
            success: res => {
                console.info("成功")
                console.info(JSON.stringify(res))
            },
            fail: err => {
                console.info("失败" + JSON.stringify(err))
            },
            complete: v => {
                console.info("结束")
            }
        })
    }
}
